<?php

/**
 * @file
 * Default theme implementation for displaying search results.
 *
 * This template collects each invocation of theme_search_result(). This and
 * the child template are dependent to one another sharing the markup for
 * definition lists.
 *
 * Note that modules may implement their own search type and theme function
 * completely bypassing this template.
 *
 * Available variables:
 * - $search_results: All results as it is rendered through
 *   search-result.tpl.php
 * - $module: The machine-readable name of the module (tab) being searched, such
 *   as "node" or "user".
 *
 *
 * @see template_preprocess_search_results()
 *
 * @ingroup themeable
 */
?>

<?php 
	
	$path = $_GET['q'];
	
	$path_array = explode('/', $_GET['q']);
	
	$searched_key = $path_array[2];

	//Linguaggio settato a 'und'
	$lang = LANGUAGE_NONE;
	//GET linguaggio
	global $language;	
	global $search_results_number;
	global $pager_total_items;
	$totale = $pager_total_items[0] ? $pager_total_items[0] : $search_results_number;

	drupal_add_css(path_to_theme().'/css/search.css', array('group' => CSS_THEME, 'weight' => 1));
	drupal_add_js(path_to_theme().'/js/seapowerOneCol.js');
?>

<!-- CORPO CENTRALE -->
<div class="corpo_centrale">
	<!-- LEFT -->
	<div class="left monoblocco" style>
		<h1><?php print ($language->language == 'it')?'RICERCA':'SEARCH';?></h1>		
		<?php if ($search_results): ?>
		  <h2><?php print t('Search results');?></h2>
		  <p>Hai cercato <b>"<?php print check_plain($searched_key);  ?>"</b> ed hai ottenuto <?php print '<b>'.$totale.'</b>' ?> risultat<?php print $totale == 1 ? 'o':'i'; ?></p>
		  <ol class="search-results <?php print $module; ?>-results">
		    <?php print $search_results; ?>
		  </ol>
		  <?php print $pager; ?>
		<?php else : ?>
		  <h2><?php print t('Your search yielded no results');?></h2>
		  <?php print search_help('search#noresults', drupal_help_arg()); ?>
		<?php endif; ?>
	</div>
</div>
